<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet" href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
/* .ui-tabs .ui-tabs-panel {
	border-width: 0;
	padding: 0.4em 0.4em;
	background: 0;
} */
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class='full-center-content-scroll-noheader'>
			<!-- <div class="col-sm-12 col-lg-12"> -->
				<h:form id="headForm">
					<p:growl id="msgs" showDetail="true" />
					<div class="box box-solid with-border">
						<div class="box-header">
							<!--交流直流的电压等级  -->
							<p:outputLabel value="电压等级：" style="margin-right:5px;"   />
							<h:selectOneMenu id="vol"  
								value="#{managementUnitMaintainController.selectdStandVolLevel}"
								style="width:100px;height:30px;margin-right:15px;">
								<f:selectItem itemLabel="全部" itemValue="" />
								<f:selectItems var="vol" value="#{ledgerQueryDataController.standVoltageLevels}"
									itemLabel="#{vol.label}" itemValue="#{vol.value}" />
							</h:selectOneMenu>
							<!--交流直流的线路首字母查询  -->
							<p:outputLabel value="线路名称：" style="margin-right:5px;"  rendered="#{!managementUnitMaintainController.tabTitleStatus}"/>
							<p:autoComplete id="lineSearch" dropdown="true"
							    rendered="#{!managementUnitMaintainController.tabTitleStatus}"
								placeholder="线路首字母查询" scrollHeight="400" size="18"
								value="#{managementUnitMaintainController.equipmentName}"
								style="margin-right:15px;"
								completeMethod="#{cimUtilController.completeLineSegment}">
							</p:autoComplete>
							<!--其他设备的所属变电站 为交流和直流时不显示  -->
							<p:outputLabel value="所属变电站： "  id="stationSearchName"  rendered="#{managementUnitMaintainController.tabTitleStatus}"/>
							<p:autoComplete id="stationSearch" dropdown="true"
							    rendered="#{managementUnitMaintainController.tabTitleStatus}"
								placeholder="变电站首字母查询" scrollHeight="400"
								value="#{managementUnitMaintainController.subStation}"
								style="margin-right:10px"
								completeMethod="#{managementUnitMaintainController.complateStation}">
							</p:autoComplete>
							<p:outputLabel value="调管单位：" style="margin-right:5px;margin-bottom:5px;" />
							<p:autoComplete dropdown="true" id="dispatchUnit_id"
								value="#{managementUnitMaintainController.queryLedger.dispatchUnit}"
								style="margin-right:10px;margin-bottom:5px;" size="18"
								scrollHeight="200" placeholder="输入拼音首字母查询"
								completeMethod="#{ledgerQueryDataController.completeDispatchUnit}">
							</p:autoComplete>
							<p:outputLabel value="运维单位：" style="margin-right:5px;margin-bottom:5px;" />
							<p:autoComplete dropdown="true" id="maintenanceUnit_id"
								value="#{managementUnitMaintainController.queryLedger.maintenanceUnit}"
								style="margin-right:10px;margin-bottom:5px;" size="18"
								scrollHeight="200" placeholder="输入拼音首字母查询"
								completeMethod="#{ledgerQueryDataController.completeMaintenanceUnit}">
							</p:autoComplete>
							<!-- <p:selectBooleanCheckbox id="checkbox" rendered="#{managementUnitMaintainController.tabTitle=='交流线路'}" value="#{managementUnitMaintainController.dispatchStatus}"  itemLabel="未关联调管单位"> 
							 <p:ajax   update="tabv:aclineForm"  listener="#{managementUnitMaintainController.dispatchQuery}"></p:ajax>
							 </p:selectBooleanCheckbox>   -->
							<p:commandButton icon="ui-icon-search" value="查询"
								update="tabv:dclineForm  toolbarForm tabv:aclineForm  tabv:busbarForm tabv:transForm tabv:breakerForm  tabv:compensatorForm  tabv:substationForm"
								actionListener="#{managementUnitMaintainController.query()}" style="margin-left:5px;" />
							<p:commandButton icon="ui-icon-refresh" value="重置" 
							update="headForm:stationSearch  dispatchUnit_id maintenanceUnit_id primary_id assetOwner_id  
							 secondary_id   toolbarForm lineSearch  vol tabv:dclineForm  tabv:aclineForm  
							tabv:substationForm tabv:busbarForm tabv:transForm tabv:breakerForm tabv:compensatorForm"
							actionListener="#{managementUnitMaintainController.reset}" style="margin-left:5px;" />
							
						  <div class="box-tools pull-right">
							<button type="button"  class="btn btn-default" onclick="onSelectDivClick();"
							   id="selectButton" title="高级查询"
							 style="margin-right:10px;">
							 <span id="selectButtonIcon" class="fa fa-caret-down">高级查询</span>
						  </button>
						  </div>
						</div>
						<div class="panel-collapse collapse" id="selectDiv" style="margin-left:10px">
						<h:panelGrid columns="6" style="margin-top:8px;margin-bottom:10px" cellpadding="6">
							<p:outputLabel value="资产归属：" style="margin-right:5px;margin-bottom:5px;" />
							<p:autoComplete dropdown="true" id="assetOwner_id"
								value="#{managementUnitMaintainController.queryLedger.assetOwner}"
								style="margin-right:10px;margin-bottom:5px;" size="18"
								scrollHeight="200" placeholder="输入拼音首字母查询"
								completeMethod="#{ledgerQueryDataController.completeAssetOwner}">
							</p:autoComplete>
							<p:outputLabel value="一次设备检修范围："  style="margin-right:5px;margin-bottom:5px;"/>
							<p:autoComplete dropdown="true" id="primary_id"
								value="#{managementUnitMaintainController.queryLedger.primaryEquipmentScope}"
								style="margin-right:15px;margin-bottom:5px;" size="18"
								scrollHeight="200" placeholder="输入拼音首字母查询"
								completeMethod="#{ledgerQueryDataController.completePrimaryAndSecondaryScope}">
							</p:autoComplete>
							<p:outputLabel value="二次设备检修范围：" style="margin-right:5px;margin-bottom:5px;"/>
							<p:autoComplete dropdown="true" id="secondary_id"
								value="#{managementUnitMaintainController.queryLedger.secondaryEquipmentScope}"
								style="margin-right:15px;margin-bottom:5px;" size="18"
								scrollHeight="200" placeholder="输入拼音首字母查询"
								completeMethod="#{ledgerQueryDataController.completePrimaryAndSecondaryScope}">
							</p:autoComplete>
						</h:panelGrid>
					</div>
					</div>
				</h:form>
                <h:form id="toolbarForm">
                  <p:toolbar id="toolbar">
					<f:facet name="left">
						<p:commandButton value="编辑" icon="ui-icon-pencil" id="editBtn"
							process="@all"   update=":editForm:editDlg"
							oncomplete="PF('editDlg').show()" 
							actionListener="#{managementUnitMaintainController.preEdit()}"
							disabled="#{managementUnitMaintainController.selectedLedgerList.size() != 1}"
							style="margin-right:5px" />
						<p:commandButton value="删除" icon="ui-icon-pencil" id="deleteBtn"
							process="@all" update = "headForm:msgs toolbarForm    tabv:substationForm tabv:dclineForm  tabv:aclineForm   tabv:busbarForm tabv:transForm tabv:breakerForm tabv:compensatorForm "
							actionListener="#{managementUnitMaintainController.delete()}"
							disabled="#{managementUnitMaintainController.selectedLedgerList.size() == 0}"
							style="margin-right:5px" >	
							<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
						</p:commandButton>
						
					</f:facet>
				</p:toolbar>
                </h:form>
				<p:tabView id="tabv" cache="false" dynamic="true" >
				    <p:ajax event="tabChange" listener="#{managementUnitMaintainController.onTabChange}" update="headForm  toolbarForm"/>
				   <p:tab title="变电站">
						<h:form id="substationForm">
							<p:dataTable id="table5" var="item"
								value="#{managementUnitMaintainController.substationModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{managementUnitMaintainController.substationModel.size()} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process="@all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"
									style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="变电站名称" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
				    <!--  交流线路-->
				    <p:tab title="交流线路"  >
				            <h:form id="aclineForm">
							<p:dataTable id="table1" var="item" rowKey="#{item.id}"
								emptyMessage="无记录" rowIndexVar="ite" 
								value="#{managementUnitMaintainController.aclineModel}"
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								lazy="true" rows="20" paginator="true" paginatorPosition="bottom"
								style="margin-bottom:0;text-align:center" 
								paginatorTemplate="{Customization} {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100">
								<f:facet name="{Customization}">
									<p:outputLabel value="总计：#{managementUnitMaintainController.aclineModel.size()} 条记录" style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process="@all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"  style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="线路名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						  </h:form>
						</p:tab>
				     <!-- 直流线路 -->
				     <p:tab title="直流线路"  >
				          <h:form id="dclineForm">
							<p:dataTable id="dcLineTable" var="item" rowKey="#{item.id}"
								emptyMessage="无记录" rowIndexVar="ite" 
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								value="#{managementUnitMaintainController.dclineModel}"
								lazy="true" rows="20" paginator="true" paginatorPosition="bottom"
								style="margin-bottom:0;text-align:center" 
								paginatorTemplate="{Customization} {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{managementUnitMaintainController.dclineModel.size()} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process="@all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"
									style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="线路名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						  </h:form>
						</p:tab>
					<p:tab title="母线">
						<h:form id="busbarForm">
							<p:dataTable id="table" var="item"
								value="#{managementUnitMaintainController.busbarModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{managementUnitMaintainController.busbarModel.size()} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process="@all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"
									style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					<p:tab title="变压器">
						<h:form id="transForm">
							<p:dataTable id="table2" var="item"
								value="#{managementUnitMaintainController.transModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{managementUnitMaintainController.transModel.size()} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process=" @all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"
									style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					<p:tab title="断路器">
						<h:form id="breakerForm">
							<p:dataTable id="table3" var="item"
								value="#{managementUnitMaintainController.breakerModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{managementUnitMaintainController.breakerModel.size()} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process="@all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"
									style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					<p:tab title="电抗器">
						<h:form id="compensatorForm">
							<p:dataTable id="table4" var="item"
								value="#{managementUnitMaintainController.compensatorModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								selection="#{managementUnitMaintainController.selectedLedgerList}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{managementUnitMaintainController.compensatorModel.size()} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:ajax event="toggleSelect" update="toolbarForm" />
								<p:ajax event="rowSelectCheckbox" process="@all" update="toolbarForm" />
								<p:ajax event="rowUnselectCheckbox" process="@all" update="toolbarForm"/>
								<p:ajax event="rowSelect" process="@all" update="toolbarForm"/>
								<p:column selectionMode="multiple"
									style="text-align:center;width:50px" />
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{item.dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{item.maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{item.unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{item.assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{item.primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{item.primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{item.secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{item.secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					
				</p:tabView>
				<h:form id="editForm">
					<p:dialog widgetVar="editDlg" id="editDlg" width="500px" height="500px" header="编辑">
						<p:toolbar>
							<f:facet name="left">
								<p:commandButton value="保存" update=" headForm:msgs toolbarForm tabv:substationForm tabv:dclineForm  tabv:aclineForm   tabv:busbarForm tabv:transForm tabv:breakerForm tabv:compensatorForm "
									icon="ui-icon-disk" oncomplete="PF('editDlg').hide()" actionListener="#{managementUnitMaintainController.save}" />
							</f:facet>
						</p:toolbar>
						<p:outputPanel style="width:100%;">
							<p:panelGrid style="width:100%;">
								<p:row  rendered="#{managementUnitMaintainController.tabTitle!='变电站'}">
									<p:column>
										<h:outputText value="名称" />
									</p:column>
									<p:column>
									<p:inputText  value="#{managementUnitMaintainController.editLedger.name}" readonly="true"/>
									</p:column>
								</p:row>
								<p:row   rendered="#{managementUnitMaintainController.tabTitleStatus}">
									<p:column>
										<h:outputText value="所属变电站" />
									</p:column>
									<p:column>
									<p:inputText  value="#{managementUnitMaintainController.editLedger.subName}" readonly="true"/>
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="调管单位" />
									</p:column>
									<p:column>
										<p:inputText id="orgDept" value="#{managementUnitMaintainController.editLedger.dispatchUnit}" readonly="true"/>
										<p:commandButton value="选择" style="margin-left:5px"
											actionListener="#{ledgerQueryDataController.getDesorgDepartDialog()}" >
											<p:ajax event="dialogReturn" listener="#{managementUnitMaintainController.onDesorgDepartChosen}"
												update="editForm:orgDept" />
										</p:commandButton>
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="资产归属" />
									</p:column>
									<p:column>
										<p:autoComplete scrollHeight="300" dropdown="true"
											value="#{managementUnitMaintainController.editLedger.assetOwner}"
											completeMethod="#{ledgerQueryDataController.completeAssetOwnerWhenEdit}" />
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="运维单位" />
									</p:column>
									<p:column>
										<p:inputText id="opCompanyDept" value="#{managementUnitMaintainController.editLedger.maintenanceUnit}" readonly="true"/>
										<p:commandButton value="选择" style="margin-left:5px"
											actionListener="#{ledgerQueryDataController.getOpDepartDialog()}" >
											<p:ajax event="dialogReturn" listener="#{managementUnitMaintainController.onOpDepartChosen}"
												update="opCompanyDept unitType" />
										</p:commandButton>
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="单位类型" />
									</p:column>
									<p:column>
										<p:autoComplete scrollHeight="300" dropdown="true" style="width:75%"
											value="#{managementUnitMaintainController.editLedger.unitType}" id="unitType"
											completeMethod="#{ledgerQueryDataController.completeUnitType}">
										</p:autoComplete>
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="一次设备检修范围" />
									</p:column>
									<p:column>
										<p:inputText id="primary" value="#{managementUnitMaintainController.editLedger.primaryEquipmentScope}" readonly="true"/>
										<p:commandButton value="选择" style="margin-left:5px"
											actionListener="#{ledgerQueryDataController.getPrimaryAndSecondaryScopeSelectDialog()}" >
											<p:ajax event="dialogReturn" listener="#{managementUnitMaintainController.onPrimaryScopeChosen}"
												update="primary" />
										</p:commandButton>
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="一次设备检修范围备注" />
									</p:column>
									<p:column>
										<p:inputText style="width:78%"
											value="#{managementUnitMaintainController.editLedger.primaryEquipmentScopeRemark}" />
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="二次设备检修范围" />
									</p:column>
									<p:column>
										<p:inputText id="secondary" value="#{managementUnitMaintainController.editLedger.secondaryEquipmentScope}" readonly="true"/>
										<p:commandButton value="选择" style="margin-left:5px"
											actionListener="#{ledgerQueryDataController.getPrimaryAndSecondaryScopeSelectDialog()}" >
											<p:ajax event="dialogReturn" listener="#{managementUnitMaintainController.onSecondryScopeChosen}"
												update="secondary" />
										</p:commandButton>
									</p:column>
								</p:row>
								<p:row>
									<p:column>
										<h:outputText value="二次设备检修范围备注" />
									</p:column>
									<p:column>
										<p:inputText style="width:78%"
											value="#{managementUnitMaintainController.editLedger.secondaryEquipmentScopeRemark}" />
									</p:column>
								</p:row>
							</p:panelGrid>
						</p:outputPanel>
					</p:dialog>
				</h:form>
			</div>
		<!-- </div> -->
	</ui:define>
	<ui:define name="contentend">
	 <script>
			function onSelectDivClick() {
				var div = $('#selectDiv');
				if (div.hasClass('in')) {
					div.collapse('hide');
					$('#selectButtonIcon').removeClass("fa fa-caret-up");
					$('#selectButtonIcon').addClass("fa fa-caret-down");
				} else {
					div.collapse('show');
					$('#selectButtonIcon').removeClass("fa fa-caret-down");
					$('#selectButtonIcon').addClass("fa fa-caret-up");
				}
			}
			function closeDivClick() {
				var div = $('#selectDiv');
				div.collapse('hide');
				$('#selectButtonIcon').removeClass("fa fa-caret-up");
				$('#selectButtonIcon').addClass("fa fa-caret-down");
			}
		</script>
	</ui:define>
</ui:composition>
